/*评论的代码*/

var LookerComment = { 

    ListURL : "http://localhost/looker/looker/index.php/Comment/show/news/{1}",
    AddURL  : "http://localhost/looker/looker/index.php/Comment/add/",
    ListLimit : 15,
    NewsHash  : 0,
    TotalCnt  : 0,
    ListDiv   : "",
    PageNavDiv : "",
    CommentTpl : "",
    MessageDiv : "comment_message",
    CommentForm : {
                name:"cmt_form_name",
                content:"cmt_form_content",
                verify:"cmt_form_verify",
                submit:"cmt_form_submit"},

    
    //分页导航对象
    pageNav : null,


    //显示一页的评论
    display : function(page){
        
        
    },

    //添加一条评论
    add : function(){
        //alert(NewsHash+"::add"),
       // alert(this.check);
        var _self = this;
        _self.check();
    },

    //从服务器获取一页评论
    getData : function(page){


    },
    //渲染这一页评论
    render : function(data){

    },


    //检查用户输入
    check : function(){
        alert("check");
        this.message("正在提交",1,2000);
    },

    //向服务器添加一条评论
    addData : function(){
s
    },

    //显示提示信息
    message : function(msg, status, interval){
        var html = "";
        if(status==0)
            html = "<font color='red'>"+msg+"<font>";
        else
            html = "<font color='blue'>"+msg+"<font>";

        var div = $("#"+this.MessageDiv);
        div.html(html);
        div.show();
        if(interval!=0)
             div.fadeOut(interval);
    },

    //初始化
    init : function(){

        $("#"+LookerComment.CommentForm.submit).bind("click","",LookerComment.add);
    }
};

$(document).ready(function(){ 
    LookerComment.NewsHash = 112213;
    LookerComment.init();
});